package control.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;



public class ParametroFilter implements Filter {

	public ParametroFilter() {

	}

	public void init(FilterConfig fc) throws SecurityException {

	}

	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		
		HttpServletRequest req = (HttpServletRequest) request;
		
		System.out.println("-------------------------------");
		System.out.println(req.getRequestURI());
		System.out.println("-------------------------------");
		
		/*	UsuarioJB usuario = new UsuarioJB();
			usuario.setNome(request.getParameter("nome"));
			usuario.setIdade(Integer.parseInt(request.getParameter("idade")));

			
			UsuarioController control = new UsuarioController();
			control.insert(usuario);
			*/
		System.out.println("filtro...");
		//chain.doFilter(request, response);
		//request.getRequestDispatcher("admin/index.jsp").forward(request, response);


	}

	public void destroy() {

	}
}
